//
//  HttpRequestManager.h
//  news_ios_app
//
//  Created by apple on 16/3/15.
//  Copyright © 2016年 apple. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AFNetworking.h>
#import <NSObject+YYModel.h>

#define appKey                  @"b11ac1c9c9ef944ed9656b32c6d17b1c"
#define newsBaseUrl             @"http://www.apikit.cn/api/"
#define findType                [NSString stringWithFormat:@"%@%@",newsBaseUrl,@"findType"]
#define findArticleByTypeId     [NSString stringWithFormat:@"%@%@",newsBaseUrl,@"findArticleByTypeId"]
#define findArticleDetailById   [NSString stringWithFormat:@"%@%@",newsBaseUrl,@"findArticleDetailById"]

typedef void(^RequestSuccess)(id data);
typedef void(^RequestFailure)(id data);

@interface HttpRequestManager : NSObject
//获取manager单例
+(AFHTTPRequestOperationManager *)sharedDefault;

//获取所有的新闻分类
+(void)HttpRequestForNewsTypeWithParameter:(NSDictionary *)parameter
                             success:(RequestSuccess)success
                             failure:(RequestFailure)failure;
//根据分类id获取所有文章
+(void)HttpRequestForArticleByTypeIdWithParameter:(NSDictionary *)parameter
                                    success:(RequestSuccess)success
                                    failure:(RequestFailure)failure;

//根据文章id获取文章详情
+(void)HttpRequestForArticleDetailByIdWithParameter:(NSDictionary *)parameter
                                      success:(RequestSuccess)success
                                      failure:(RequestFailure)failure;
@end
